<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.13"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>SC2API: sc2::SC2Type&lt; T &gt; Class Template Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectlogo"><img alt="Logo" src="SC2-Logo.png"/></td>
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">SC2API
   </div>
   <div id="projectbrief">An API for AI for StarCraft II</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.13 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
</script>
<div id="main-nav"></div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div id="nav-path" class="navpath">
  <ul>
<li class="navelem"><b>sc2</b></li><li class="navelem"><a class="el" href="classsc2_1_1_s_c2_type.html">SC2Type</a></li>  </ul>
</div>
</div><!-- top -->
<div class="header">
  <div class="summary">
<a href="#pub-methods">Public Member Functions</a> &#124;
<a href="classsc2_1_1_s_c2_type-members.html">List of all members</a>  </div>
  <div class="headertitle">
<div class="title">sc2::SC2Type&lt; T &gt; Class Template Reference</div>  </div>
</div><!--header-->
<div class="contents">

<p><code>#include &lt;<a class="el" href="sc2__types_8h_source.html">sc2_types.h</a>&gt;</code></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr class="memitem:a797ecedf348b295b1827f6cd875843e7"><td class="memItemLeft" align="right" valign="top"><a id="a797ecedf348b295b1827f6cd875843e7"></a>
&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classsc2_1_1_s_c2_type.html#a797ecedf348b295b1827f6cd875843e7">SC2Type</a> ()</td></tr>
<tr class="memdesc:a797ecedf348b295b1827f6cd875843e7"><td class="mdescLeft">&#160;</td><td class="mdescRight">Default constructor. <br /></td></tr>
<tr class="separator:a797ecedf348b295b1827f6cd875843e7"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:adda8c2ecd47bf1fe93ad54726404674f"><td class="memItemLeft" align="right" valign="top"><a id="adda8c2ecd47bf1fe93ad54726404674f"></a>
&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classsc2_1_1_s_c2_type.html#adda8c2ecd47bf1fe93ad54726404674f">SC2Type</a> (uint32_t type_id)</td></tr>
<tr class="memdesc:adda8c2ecd47bf1fe93ad54726404674f"><td class="mdescLeft">&#160;</td><td class="mdescRight">Construct from an integer, corresponds to the enum value. <br /></td></tr>
<tr class="separator:adda8c2ecd47bf1fe93ad54726404674f"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ac956d32e3d7989b2e0ab2664c9822d16"><td class="memItemLeft" align="right" valign="top"><a id="ac956d32e3d7989b2e0ab2664c9822d16"></a>
&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classsc2_1_1_s_c2_type.html#ac956d32e3d7989b2e0ab2664c9822d16">SC2Type</a> (T type_id)</td></tr>
<tr class="memdesc:ac956d32e3d7989b2e0ab2664c9822d16"><td class="mdescLeft">&#160;</td><td class="mdescRight">Construct from the enum. <br /></td></tr>
<tr class="separator:ac956d32e3d7989b2e0ab2664c9822d16"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a499b06e107c0561ce3d2d80094fbdd94"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classsc2_1_1_s_c2_type.html#a499b06e107c0561ce3d2d80094fbdd94">operator==</a> (<a class="el" href="classsc2_1_1_s_c2_type.html">SC2Type</a>&lt; T &gt; type_id) const</td></tr>
<tr class="separator:a499b06e107c0561ce3d2d80094fbdd94"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a404a385de418d89ea84344d9ac7fd728"><td class="memItemLeft" align="right" valign="top"><a id="a404a385de418d89ea84344d9ac7fd728"></a>
bool&#160;</td><td class="memItemRight" valign="bottom"><b>operator==</b> (T type_id) const</td></tr>
<tr class="separator:a404a385de418d89ea84344d9ac7fd728"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a4dcadbfd52b9acde5f49b2d452ac08fa"><td class="memItemLeft" align="right" valign="top"><a id="a4dcadbfd52b9acde5f49b2d452ac08fa"></a>
bool&#160;</td><td class="memItemRight" valign="bottom"><b>operator==</b> (uint32_t type_id) const</td></tr>
<tr class="separator:a4dcadbfd52b9acde5f49b2d452ac08fa"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ade586b36531920f32527128774df00b7"><td class="memItemLeft" align="right" valign="top"><a id="ade586b36531920f32527128774df00b7"></a>
bool&#160;</td><td class="memItemRight" valign="bottom"><b>operator==</b> (int type_id) const</td></tr>
<tr class="separator:ade586b36531920f32527128774df00b7"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a6e032550a699843364b52d9f30d7ddcc"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classsc2_1_1_s_c2_type.html#a6e032550a699843364b52d9f30d7ddcc">operator!=</a> (<a class="el" href="classsc2_1_1_s_c2_type.html">SC2Type</a>&lt; T &gt; type_id) const</td></tr>
<tr class="separator:a6e032550a699843364b52d9f30d7ddcc"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:af18f2a54f07829ae2cc8501301f1764f"><td class="memItemLeft" align="right" valign="top"><a id="af18f2a54f07829ae2cc8501301f1764f"></a>
bool&#160;</td><td class="memItemRight" valign="bottom"><b>operator!=</b> (T type_id) const</td></tr>
<tr class="separator:af18f2a54f07829ae2cc8501301f1764f"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:afa64fdd5adf5eca49d3a95826e884fa1"><td class="memItemLeft" align="right" valign="top"><a id="afa64fdd5adf5eca49d3a95826e884fa1"></a>
bool&#160;</td><td class="memItemRight" valign="bottom"><b>operator!=</b> (uint32_t type_id) const</td></tr>
<tr class="separator:afa64fdd5adf5eca49d3a95826e884fa1"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a8195d6f42d7e7c193bf08dbd146ef22c"><td class="memItemLeft" align="right" valign="top"><a id="a8195d6f42d7e7c193bf08dbd146ef22c"></a>
bool&#160;</td><td class="memItemRight" valign="bottom"><b>operator!=</b> (int type_id) const</td></tr>
<tr class="separator:a8195d6f42d7e7c193bf08dbd146ef22c"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a9ad0dc8b2a47eca60fa3a49c9c2e5de0"><td class="memItemLeft" align="right" valign="top"><a id="a9ad0dc8b2a47eca60fa3a49c9c2e5de0"></a>
bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classsc2_1_1_s_c2_type.html#a9ad0dc8b2a47eca60fa3a49c9c2e5de0">operator&lt;</a> (const <a class="el" href="classsc2_1_1_s_c2_type.html">SC2Type</a>&lt; T &gt; &amp;other) const</td></tr>
<tr class="memdesc:a9ad0dc8b2a47eca60fa3a49c9c2e5de0"><td class="mdescLeft">&#160;</td><td class="mdescRight">Test comparison. <br /></td></tr>
<tr class="separator:a9ad0dc8b2a47eca60fa3a49c9c2e5de0"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ab75e39605288070327604d10a5f720bf"><td class="memItemLeft" align="right" valign="top"><a id="ab75e39605288070327604d10a5f720bf"></a>
&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classsc2_1_1_s_c2_type.html#ab75e39605288070327604d10a5f720bf">operator uint32_t</a> () const</td></tr>
<tr class="memdesc:ab75e39605288070327604d10a5f720bf"><td class="mdescLeft">&#160;</td><td class="mdescRight">Cast to integer. <br /></td></tr>
<tr class="separator:ab75e39605288070327604d10a5f720bf"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a16ef14791e484bcb2708d262fbfbc46f"><td class="memItemLeft" align="right" valign="top"><a id="a16ef14791e484bcb2708d262fbfbc46f"></a>
&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classsc2_1_1_s_c2_type.html#a16ef14791e484bcb2708d262fbfbc46f">operator T</a> () const</td></tr>
<tr class="memdesc:a16ef14791e484bcb2708d262fbfbc46f"><td class="mdescLeft">&#160;</td><td class="mdescRight">Cast to enum type. <br /></td></tr>
<tr class="separator:a16ef14791e484bcb2708d262fbfbc46f"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a359fd3f5911b611089dac072f2ba528f"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classsc2_1_1_s_c2_type.html#a359fd3f5911b611089dac072f2ba528f">IsValid</a> () const</td></tr>
<tr class="separator:a359fd3f5911b611089dac072f2ba528f"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a25533b72e301be4064d80a13c82dc506"><td class="memItemLeft" align="right" valign="top">std::string&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classsc2_1_1_s_c2_type.html#a25533b72e301be4064d80a13c82dc506">to_string</a> () const</td></tr>
<tr class="separator:a25533b72e301be4064d80a13c82dc506"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ada2d70972edaa615780f86165b7e87a3"><td class="memItemLeft" align="right" valign="top">T&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classsc2_1_1_s_c2_type.html#ada2d70972edaa615780f86165b7e87a3">ToType</a> () const</td></tr>
<tr class="separator:ada2d70972edaa615780f86165b7e87a3"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><h3>template&lt;class T&gt;<br />
class sc2::SC2Type&lt; T &gt;</h3>

<p>Template class for defining common game enum types. The template parameter is the enum. This class allows for seamless conversion between enum types and integers, while maintaining strong typing. This means, for example, that a unit type ID can be converted back and forth from an integer, but can't be used when another type ID, e.g., an ability ID, is required as a parameter. </p>
</div><h2 class="groupheader">Member Function Documentation</h2>
<a id="a359fd3f5911b611089dac072f2ba528f"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a359fd3f5911b611089dac072f2ba528f">&#9670;&nbsp;</a></span>IsValid()</h2>

<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;class T&gt; </div>
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">bool <a class="el" href="classsc2_1_1_s_c2_type.html">sc2::SC2Type</a>&lt; T &gt;::IsValid </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p>Determines if the value contained is valid. </p><dl class="section return"><dt>Returns</dt><dd>'true' if the value is valid. </dd></dl>

</div>
</div>
<a id="a6e032550a699843364b52d9f30d7ddcc"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a6e032550a699843364b52d9f30d7ddcc">&#9670;&nbsp;</a></span>operator!=()</h2>

<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;class T&gt; </div>
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">bool <a class="el" href="classsc2_1_1_s_c2_type.html">sc2::SC2Type</a>&lt; T &gt;::operator!= </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="classsc2_1_1_s_c2_type.html">SC2Type</a>&lt; T &gt;&#160;</td>
          <td class="paramname"><em>type_id</em></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p>Test non-equivalence. </p><dl class="section return"><dt>Returns</dt><dd>'true' if the values are not equal. </dd></dl>

</div>
</div>
<a id="a499b06e107c0561ce3d2d80094fbdd94"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a499b06e107c0561ce3d2d80094fbdd94">&#9670;&nbsp;</a></span>operator==()</h2>

<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;class T&gt; </div>
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">bool <a class="el" href="classsc2_1_1_s_c2_type.html">sc2::SC2Type</a>&lt; T &gt;::operator== </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="classsc2_1_1_s_c2_type.html">SC2Type</a>&lt; T &gt;&#160;</td>
          <td class="paramname"><em>type_id</em></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p>Test equivalence. </p><dl class="section return"><dt>Returns</dt><dd>'true' if the values are equal. </dd></dl>

</div>
</div>
<a id="a25533b72e301be4064d80a13c82dc506"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a25533b72e301be4064d80a13c82dc506">&#9670;&nbsp;</a></span>to_string()</h2>

<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;class T&gt; </div>
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">std::string <a class="el" href="classsc2_1_1_s_c2_type.html">sc2::SC2Type</a>&lt; T &gt;::to_string </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p>String of the integer value. </p><dl class="section return"><dt>Returns</dt><dd>The string of the value. </dd></dl>

</div>
</div>
<a id="ada2d70972edaa615780f86165b7e87a3"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ada2d70972edaa615780f86165b7e87a3">&#9670;&nbsp;</a></span>ToType()</h2>

<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;class T&gt; </div>
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">T <a class="el" href="classsc2_1_1_s_c2_type.html">sc2::SC2Type</a>&lt; T &gt;::ToType </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p>Explicit conversion to the enum type. </p><dl class="section return"><dt>Returns</dt><dd>The enum. </dd></dl>

</div>
</div>
<hr/>The documentation for this class was generated from the following file:<ul>
<li>include/sc2api/<a class="el" href="sc2__types_8h_source.html">sc2_types.h</a></li>
</ul>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.13
</small></address>
</body>
</html>
